#! /bin/sh
/home/guillaume/.bashrc

#Goto here
here="/users/left/guillaume/bots"
cd $here

#Marvin feed address
feed="http://data.mohid.com/~guillaume/FileIt/marvinquotes_srtd.txt"

#temporary file
file="marvin_bot"

#Weather twitter bot
twitbot=login:passw

#Read the feed and randomize it
curl $feed | shuffle | tail -n 1 > $file.txt

#Read the message into a weather variable
read mess < $file.txt
echo $mess >> $file.log

#Timestamp the log file
echo -------------------------------------------->> $file.log
date >> $file.log

#Twit the weather variable away
curl --basic --user $twitbot --data status="$mess" http://twitter.com/statuses/update.xml >> $file.log
